package HoneWork;
interface A {
    public void printInfo();
}
class B implements A {
    @Override
    public void printInfo() {
        System.out.println("Hello World!");
    }
}
class X {
    public void fun(A a) {
        a.printInfo();
    }
}

public class Test_3 {
    public static void main(String[] args) {
        new X().fun(new B() {
            @Override
            public void printInfo() {
                System.out.println("Hello World!");
            }
        });
    }
}
